﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML
        xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<HEAD>
    <META content="IE=11.0000" http-equiv="X-UA-Compatible">
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <TITLE>投票列表</TITLE>
    <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        function del(sid) {
            if(confirm("是否删除？")) {
                window.location.href = "del?sid=" + sid
            }
        }
    </script>
    <LINK href="css/style.css" rel="stylesheet" type="text/css">
    <META name="GENERATOR" content="MSHTML 11.00.10586.420">
</HEAD>
<BODY>
<DIV class="wrap" id="header"><IMG src="images/logo.gif"></DIV>
<DIV class="wrap" id="navbar">
    <DIV class="profile" >
        <span th:text="${session.uname}">阿凡达</span>
        <SPAN class="return"><A th:href="@{slist(weihu=1)}">返回列表</A></SPAN>
        <SPAN class="addnew"><A href="add.html">添加新投票</A></SPAN>
        <SPAN class="modify" th:if="${session.status=='1'}" >
            <A th:href="@{toweihu}">维护</A>
        </SPAN>
        <SPAN class="return"><A th:href="@{esc}">注销</A></SPAN>
    </DIV>
    <DIV class="search">
        <FORM action="slist">
            <INPUT name="title" th:value="${title}" class="input-text" type="text">
            <INPUT class="input-button" type="submit" value=""/>
        </FORM>
    </DIV>
</DIV>
<DIV class="wrap" id="vote">
    <H2>投票列表</H2>
    <BR>
    <UL class="list">
        <LI class="odd" th:each="s:${slist}">
            <H4><A th:text="${s.title}" th:href="@{toVote(sid=${s.sid})}"></A>
            </H4>
            <DIV class="join" th:switch="${session.weihu}">
                <span th:case="'weihu'">
                    <a th:href="@{update(sid=${s.sid})}">维护</a>
                    &nbsp;
                    <a href="javascript:void(0)" th:onclick="del([[${s.sid}]])">删除</a>
                </span>
                <span th:case="*"><A class="aaa" th:href="@{toVote(sid=${s.sid})}">我要参与</A></span>
            </DIV>
            <P class="info" th:text="'共有 '+${s.js}+' 个选项，已有'+${s.sum}+' 个投票'"></P>
        </LI>
    </UL>
    <DIV style="float: right;">
        <A th:href="@{slist(indexs=1,title=${title})}">首页</A>
        | <a th:href="@{slist(indexs=${slist.getPageNum()-1},title=${title})}">上一页</a> | <a th:href="@{slist(indexs=${slist.getPageNum()+1},title=${title})}">下一页</a> |
        <A th:href="@{slist(indexs=${slist.getPages()},title=${title})}">末页</A>
    </DIV>
</DIV>
<DIV class="wrap" id="footer"> 北大青鸟 © 版权所有</DIV>
</BODY>
</HTML>
